Skip to content

Add source adapter format-drift smoke tests - #81

Merged
catoncat merged 1 commit into
mainfrom
agent/issue-73-format-drift-fixtures
Jun 28, 2026
Merged

Add source adapter format-drift smoke tests#81
catoncat merged 1 commit into
mainfrom
agent/issue-73-format-drift-fixtures

Conversation

@catoncat

@catoncat catoncat commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Linked issue

Refs #73

Scope

Adds malformed JSONL and format-drift smoke coverage for the experimental Claude Code and Pi source adapters. This is an independent test-only slice for the source-adapter hardening work.

Implementation summary

  • Added a Claude Code fixture in src/sources/claude-code.test.ts that mixes malformed JSON, unsupported record types, accepted user/assistant messages, and attachment-like content.
  • Added a Pi fixture in src/sources/pi.test.ts that mixes malformed JSON, unsupported future events, accepted messages, unsupported tool-call content, and a compaction summary.
  • Asserted unsupported or malformed text does not leak into findSessions or getMessagePage, while accepted transcript/session evidence remains searchable.

Verification

  • npx vitest run src/sources/claude-code.test.ts src/sources/pi.test.ts -> passed, 2 files / 20 tests.
  • npm run check -> passed, TypeScript plus 30 files / 205 tests.
  • git diff --check -- src/sources/claude-code.test.ts src/sources/pi.test.ts -> passed.

Risk

Low. This PR changes tests only; it does not change parser, source adapter, database, or CLI behavior.

Base branch / dependencies

Trace: request_id: cxs_continue_roadmap_to_completion_20260626T054330Z_api_append


Summary by cubic

Add format-drift smoke tests for claude-code and pi source adapters to ensure malformed/unsupported records are skipped and never indexed or shown. This supports Issue #73 by confirming accepted messages stay searchable and sessions render correctly.

  • New Features
    • claude-code: tests mixing malformed JSON, unsupported system records, valid user/assistant messages; verifies no leakage from attachments or bad lines.
    • pi: tests mixing malformed JSON, unsupported future events/tool calls, valid messages, and a compaction summary; verifies only accepted content is searchable.

Written for commit bae64c6. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@catoncat
catoncat merged commit 9657abc into main Jun 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant